package com.rentcars.utils;

import java.util.UUID;

/**
 * 产生UUID随机字符串工具类
 */
public final class UuidUtil {
	private UuidUtil(){}
	public static String getUuid(){
		return UUID.randomUUID().toString().replace("-","");
	}

	public static Integer getUUIDInOrderId(){
		Integer orderId=UUID.randomUUID().toString().hashCode();
		orderId = orderId < 0 ? -orderId : orderId; //String.hashCode() 值会为空
		return orderId;
	}
	/**
	 * 测试
	 */
	public static void main(String[] args) {
	}
}
